package com.csw.foodRecommendation.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.csw.foodRecommendation.entity.Admin;
import com.csw.foodRecommendation.service.AdminService;

/**
 * @author 1
 */
@Controller
@RequestMapping("admin")
public class AdminController {
	@Autowired
	private AdminService adminService;

	@RequestMapping("login")
	public String login(Admin admin) {
		Admin aa = adminService.queryByNameAndPassword(admin.getName(), admin.getPassword());
		if (aa != null) {
			return "redirect:/list/queryAll";
		} else {
			return "back/login";
		}
	}
}
